/* VuePress tabs */
@import '~vuepress-plugin-tabs/dist/themes/default'
@import 'vuepress-tabs-custom'

/* Scrollbar styles */
@import 'scrollbar'

/* Code group tabs */
@import 'code-group'

/* Table of contents (menu) */
@import 'table-of-contents'

/* Forms */
@import 'form'

/* Examples */
@import 'examples'

/* Sidebar */
@import 'sidebar'

/* Navbar */
@import 'navbar'

/* Cookiebot */
@import 'cookiebot'

/* Code fields */
@import 'code'

/* Handsontable styles */
@import 'handsontable'

/* Themes */
@import 'theme-dark'

html {
  color-scheme light
  /* Fix for anchor correct scroll positioning */
  scroll-padding-top ($navbarHeight + 1.1rem)
}

body {
  font-size 16px
}

body, html, #app {
  min-height 100vh
}

body div {
  user-select initial
}

.hidden {
  display none
}

/* Layout */

.page {
  // limit the width for enormously big screens, this way it looks good
  max-width: $homePageWidth;
  padding: 7rem 20rem 0;

  @media (max-width: $large) {
    padding-right: 3rem;
  }

  // floating sidebar should be inline on mobile, and float on wider screens
  @media (max-width: $medium) {
    padding: 7rem 2rem 1rem;
    margin: 0;
  }

  // fix for layout overlapping. Works for IE10+
  @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    float: left;
  }
}

a.source-code-link {
  font-size 12px
  float right
  top -34px
  position relative
  color #444

  @media (max-width: $medium) {
    float none
    top 0
  }
}

.theme-default-content:not(.custom) > h4,
.theme-default-content:not(.custom) > h5,
.theme-default-content:not(.custom) > h6 {
  margin-top: -2.8rem;
}

/* Page elements */

.page-top, .page-edit, .page-nav {
  margin: 0 auto;
  padding: 0;
}

.page-nav {
  margin-top: 0 !important;
}

.page-edit {
  margin-top: 60px !important;
}

.theme-default-content:not(.custom), .page-top {
  width: 100%;
  min-width: 200px;
  max-width: $contentWidth;
  padding: 0;
}

.theme-default-content > h1:first-child {
  padding-top: 2rem;
}

/* iFrames */
.iframe-container {
  overflow: hidden;
  // aspect ration of the video (for 16:9 it is 9/16= 0.5625)
  padding-top: 56.25%;
  position: relative;
}

.iframe-container iframe {
  border: 0;
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

.example-container iframe {
  width: 100%;
  height: 466px;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
}

/*
  TODO: It's workaround, and it should be removed. It seems that there is no option to disable title for a custom
  containers: https://v1.vuepress.vuejs.org/guide/markdown.html#custom-containers
*/
.custom-block-title {
  display: none;
}

/*
  TODO: It's workaround, and it should be removed. It seems that there is no option to disable title for a custom
  containers: https://v1.vuepress.vuejs.org/guide/markdown.html#custom-containers
*/
.custom-block {
  border-radius: 6px;

  &.tip {
    border: 2px solid #2456f2;
    border-radius: 6px;

    .tip-icon {
      width: 26px;
      height: 26px;
      position: relative;
      top: 1px;
      left: -7px;
      vertical-align: top;
    }
  }
}

/* Larger bottom gap of H1, H2, H3 */
h1 {
  font-size: 2rem;
  margin-bottom: 2rem !important;
  padding-top: 0 !important;
  margin-top: 0.7rem !important;
  position: relative;

  .header-framework {
    position: absolute;
    top: -24px;
    font-size: 16px;
    opacity: .8;
  }
}

h2 {
  margin-bottom: 1rem !important;
  padding-bottom: 6px;
  font-size: 1.55rem;
  padding-top: 0.5rem !important;
  margin-top: 1.3rem !important;
  border: none;
}

h3 {
  margin-bottom: 1rem !important;
  font-size: 1.25rem;
  padding-top: 0.1rem !important;
  padding-bottom: 0.1rem !important;
  margin-top: 1.1rem !important;
}

h4 {
  font-size: 1.15rem;
}

h5 {
  font-size: 1em;
}

h1, h2, h3, h4, h5 {

  a.header-anchor::before {
    content: '#';
    visibility: 'hidden';
  }

  a.header-anchor:focus {
    opacity: 1;
  }

  &:hover {
    visibility: 'visible';
  }
}

.page {
  ul, ol {
      padding-left: 2.2em;
  }
  ul {
      list-style-type: square;
      word-wrap: break-word;
  }
}

a {
  color: #104bcd;
  font-weight: 400;
}

/* A div that makes the table scrollable used in the /setting-options page */
.scrollable-table {
  height: 382px;
  overflow-x: scroll;
}

table.htCore {
  display: table;
}

table.pika-table {
  display: table;
  margin: 0;
}

table {
  width: 100%;

  tr {
    border-top: none;
  }

  td {
    white-space: normal;

    @media (max-width: $large) {
      white-space: nowrap;
    }
  }

  th, td {
    border: none;
    border-bottom: 1px solid #e9eef2;
    line-height: 1.7;
    text-align: left;
  }
}

.tabs-component-tab.js-fiddle-tab {
  position: absolute;
  top: 6px;
  right: 5px;
}

.page-nav .inner {
  border-color: #e9eef2;
}

/* A navigation element containing clickable fields (columns) */
.row-items-container {
  margin: 30px 0 30px;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: flex-start;
  align-content: normal;
  flex-wrap: wrap;

  .row-item {
    width: calc(20% - 48px);
    margin: 0 6px;
    flex-grow: 1;
    flex-basis: auto;
    text-align: center;
    color: $textColor;
    border: 1px solid #e9eef2;
    border-radius: 8px;
    transition: all .15s ease;

    @media(max-width: $large) {
      width: calc(50% - 28px);
      margin-bottom: 10px;
    }

    &:hover {
      text-decoration: none!important;
      box-shadow: 0 3px 12px #e9eef2;
    }

    img {
      margin-top: 14px;
      max-height: 45px;
    }

    h3 {
      margin-top: 10px!important;
      padding-top: 0!important;
      font-size: 16px;
    }
  }
}

.theme-default-content code {
  color: $textColor;
  background-color: #eef0f7;
}

.sidebar {
  scrollbar($scrollbarBackgroundColor, $scrollbarThumbColor, $scrollbarThumbColorHover)
}

/* Table of contents */
.table-of-contents {
  scrollbar($scrollbarBackgroundColor, $scrollbarThumbColor, $scrollbarThumbColorHover)
}

/* Tabs component */
.tabs-component {
  .tabs-component-tab {
    font-size: 15px;
  }
  .tabs-component-panels {
    padding: 16px 16px;
    section {
      pre {
        scrollbar($scrollbarDarkBackgroundColor, $scrollbarDarkThumbColor, $scrollbarDarkThumbColorHover)
      }
      &#code {
        pre {
          padding 20px 24px
          scrollbar($scrollbarDarkBackgroundColor, $scrollbarDarkThumbColor, $scrollbarDarkThumbColorHover)
        }
      }

      &#html {
        pre {
          scrollbar($scrollbarBackgroundColor, $scrollbarThumbColor, $scrollbarThumbColorHover)
        }
      }
    }
  }
}

/* Language specific code blocks */
div[class*="language-"] {
  pre {
    scrollbar($scrollbarBackgroundColor, $scrollbarThumbColor, $scrollbarThumbColorHover)
  }
}

/* Table styling starts */
.scrollable-table {
  scrollbar($scrollbarBackgroundColor, $scrollbarThumbColor, $scrollbarThumbColorHover)
}

/* Keyboard keys names formatting */
kbd {
  padding: 0 0.25em;
  font-size: 13px;
  white-space: nowrap;
  border: 1px solid #bbc6d3;
  border-bottom-width: 2px;
  background: #fafbff;
}

@media (max-width: $extraLarge) {
  kbd {
    white-space: pre-wrap;
    display: inline-block;
  }
}

/* Styles for the icon-pack page */

.icons-wrapper {
  margin-top: 30px;
  text-align: center;

  & > div {
    display: inline-block;
    width: 19%;
    margin: 0 0 2.4rem 0;
    line-height: 1;
  }

  svg {
    width: 48px;
    height: 48px;
    fill: #282c34;
  }

  span {
    padding: 0 10px;
    display: block;
    white-space: word-wrap;
    overflow: hidden;
    font-size: 12px;
    text-align: center;
  }
}

@media (max-width: $extraLarge) {
  .icons-wrapper {
    > div {
      width: 49%;
    }

    svg {
      width: 55px;
      height: 55px;
    }
  }
}

/* Code field styling */

@media (max-width: $extraLarge) {
  .theme-default-content div[class*="language-"] {
    margin initial
  }
}

/* Handsontable drawing on the introduction page */

.handsontable-drawing {
  width: 90%;
  margin: 0 auto;

  p {
    &:last-child {
      display: none;
    }
  }
}

.tabs-button-wrapper {
  .tabs-button-list {
    display: flex;
    justify-content: flex-end;
    gap: 0.1em;

    button {
      padding: 7px !important;
      margin-right: 0;
      min-width: 20px;
      background: transparent;
      &:hover{
        background: #454554;
      }
    }
  }
}

@media (max-width: 1192px) {
  .tabs-button-wrapper {
    display: flex;
    flex-direction: column;
    margin: 1em 0;
    gap: 1em;

    .tabs-button-list {
      order: 1;
    }
  }
}

@media (min-width: 1193px) {
  .tabs-button-wrapper {
    position: relative;
    
    .tabs-button-list {
      height: 0;
      position: relative;
      position: absolute;
      right: 8px;
      top: 8px;
      z-index: 1;
    }
  }
}
